package com.qf.market.service;

import com.github.pagehelper.PageInfo;

import com.qf.market.dao.CustomerDao;
import com.qf.market.po.Customer;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class CustomerServiceImpl implements CustomerService{
    @Resource
    CustomerDao customerDao;

    @Override
    public PageInfo<Customer> getAllCustomerByPage(Map params) {
        List<Customer> customerList=customerDao.getAllCustomerByPage(params);
        PageInfo<Customer> pageInfo = new PageInfo<Customer>(customerList);
        return pageInfo;
    }

    @Override
    public boolean addCustomer(Customer customer) {
        boolean f=customerDao.addCustomer(customer) > 0?true:false;
        return f;
    }

    @Override
    public boolean updateCustomer(Customer customer) {

        return customerDao.updateCustomer(customer) > 0;
    }

    @Override
    public boolean updateStatus(Customer customer) {
        return customerDao.updateStatus(customer) > 0;
    }

}
